<?php
$oClientgroups = ClientHandler::getClientgroups();
$oAppconfig = AppconfigHandler::getConfig();
$oUsers = UserHandler::getUsers();
?>
<div id="layer_client_groups" class="hidden" style="visibility: visible;">
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="2"><?php print msg('Clientlists') ?></td>
	</tr>
	<tr>
		<td class="listtop center">
<?php
if (@$oAppconfig['bFreeClientlists'] || $oUsers[$_SESSION['rid']]->bAccountant) {
	print '<a href="javascript: showBox(\'client-groupadd\');"><img src="images/'.$_SESSION['oUserVars']['images'].'/clientgroup-add.png" border="0"></a>';
}
else {
	print '&nbsp;';
}
?>
		</td>
		<td class="listtop center"><?php print msg('Clientlist') ?></td>
	</tr>
<?php
foreach ($oClientgroups as $iID => $oThisClientgroup) {
	?>
	<tr>
		<td class="listentity center">
	<?php
	if (ClientHandler::getAccess($iID) == 'admin') {
		?>
			<a href="javascript: showBox('client-groupdelete', 'iClientgroup=<?php print $iID ?>');"><img src="images/<?php print $_SESSION['oUserVars']['images'] ?>/clientgroup-delete.png" border="0"></a>
			<a href="javascript: showBox('client-groupchange', 'iClientgroup=<?php print $iID ?>');"><img src="images/<?php print $_SESSION['oUserVars']['images'] ?>/clientgroup-change.png" border="0"></a>
		<?php
	}
	else {
		print '&nbsp;';
	}
	?>
		</td>
		<td class="listentity"><?php print $oThisClientgroup->sName ?></td>
	</tr>
	<?php
}
?>
	<tr>
		<td class="boxbody center" colspan="2">
			<input type="button" value="<?php print msg('Cancel') ?>" onClick="layerHide('layer_client_groups');">
		</td>
	</tr>
</table>
</div>
